<?php
	header("Content-type:text/html;charset=utf-8");
	
	$tel = $_REQUEST["Teld"];

	
	//1.创建连接对象，登录数据库
	$conn = mysql_connect("localhost","root","root");
	
	if($conn){
		echo "连接成功"."<br/>";
		//2.选择数据库 
		mysql_select_db("2010");
	}
	
	//3.增删改 查
	//增
	//mysql_query("insert into student values (6,'小王',66)",$conn);
	//删
	//mysql_query("delete from student where stu_id = 6",$conn);
	//改
	//mysql_query("update student set stu_name = 'mayang' where stu_id = 1",$conn);
	
	//查
	//返回结果集
	$result = mysql_query("select * from phone where Teld= '$tel' ",$conn);
	if($rows == 1){
		echo "登录成功";
	}else{
		echo "尿了";
	}
	       	// 先查询注册的账号是否已存在    
	       	// $query_res = mysqli_query($conn,$result);    
	       	// $query_arr = mysqli_fetch_all($query_res,1);    
	       	// if (count($query_arr) > 0) {      
	       	// 	echo '{"err":-4,"msg":"账号已被占用"}';    
	       	// } else {      
	       	// 	// 可以注册，插入数据      
	       	// 	$insert_sql = "insert into phone(Teld) values('$tel')";      
	       	// 	mysqli_query($conn,$insert_sql);      
	       	// 	$num = mysqli_affected_rows($conn);      
	       	// 	f ($num > 0){        
	       	// 		echo '{"err":1,"msg":"注册成功"}';      
	       	// 	} else {        
	       	// 		echo '{"err":-5,"msg":"注册失败"}';      
	       	// 	}    
	       	// }  

	//4.关闭资源de
	mysql_close($conn);
?>